import request from '@/utils/request'
import Qs from 'qs'

export function listOrder(data) {
  return request({
    url: '/order/list',
    method: 'post',
    data: data,
  })
}

export function listInMember(query) {
  return request({
    url: '/order/listInMember',
    method: 'get',
    params: query,
    paramsSerializer: function (params) {
      return Qs.stringify(params, { arrayFormat: 'repeat' })
    }
  })
}

export function detailOrder(id) {
  return request({
    url: '/order/detail',
    method: 'get',
    params: { id }
  })
}

export function shipOrder(data) {
  return request({
    url: '/order/ship',
    method: 'post',
    data
  })
}

export function refundOrder(data) {
  return request({
    url: '/order/refund',
    method: 'post',
    data
  })
}

export function replyComment(data) {
  return request({
    url: '/order/reply',
    method: 'post',
    data
  })
}

export function remarkOrder(data) {
  return request({
    url: '/order/remark',
    method: 'post',
    data
  })
}

// 订单汇总统计
export function orderTotalStatistics(query) {
  return request({
    url: '/order/order_total_statistics',
    method: 'get',
    params: query
  })
}


// 订单月统计
export function orderMonthStatistics(query) {
  return request({
    url: '/order/order_month_statistics',
    method: 'get',
    params: query
  })
}

// 订单日统计
export function orderDayStatistics(query) {
  return request({
    url: '/order/order_day_statistics',
    method: 'get',
    params: query
  })
}

// 订单小时统计
export function orderHourStatistics(query) {
  return request({
    url: '/order/order_hour_statistics',
    method: 'get',
    params: query
  })
}


// 小时对比折线图
export function orderHourStatisticsLine(data) {
  return request({
    url: '/order/order_hour_statistics_line',
    method: 'post',
    data
  })
}


// 订单统计详情
export function orderDayDetail(data) {
  return request({
    url: '/order/order_day_detail',
    method: 'post',
    data
  })
}

// 订单统计详情
export function shopOrderDayDetail(query) {
  return request({
    url: '/order/shop_order_day_statistics',
    method: 'get',
    params: query
  })
}

// 查询订单备注列表
export function orderGetRemarks(orderId) {
  return request({
    url: '/order/get_remarks',
    method: 'get',
    params: { orderId }
  })
}

// 订单退款统计查询
export function orderRefundStatistics(query) {
  return request({
    url: '/refund/statistics',
    method: 'get',
    params: query
  })
}

// 订单退款汇总统计查询
export function orderRefundTotalStatistics(query) {
  return request({
    url: '/refund/total_statistics',
    method: 'get',
    params: query
  })
}

// 订单代退款汇总统计查询
export function orderAgentRefundStatistics(query) {
  return request({
    url: '/refund/proxy_statistics',
    method: 'get',
    params: query
  })
}

// 订单代退款汇总统计查询
export function orderAgentRefundTotalStatistics(query) {
  return request({
    url: '/refund/proxy_total_statistics',
    method: 'get',
    params: query
  })
}

// 店铺订单退款查询
export function orderShopRefundList(query) {
  return request({
    url: '/refund/shop_refund_list',
    method: 'get',
    params: query
  })
}

// 店铺订单退款汇总查询
export function orderShopRefundTotalStatistics(query) {
  return request({
    url: '/refund/total_shop_statistics',
    method: 'get',
    params: query
  })
}

// 店铺代订单退款查询
export function orderShopAgentRefundList(query) {
  return request({
    url: '/refund/shop_proxy_refund_list',
    method: 'get',
    params: query
  })
}

// 店铺订单代退款汇总查询
export function orderShopAgentRefundTotalStatistics(query) {
  return request({
    url: '/refund/total_shop_proxy_statistics',
    method: 'get',
    params: query
  })
}

// 订单退款详情
export function orderRefundDetail(id) {
  return request({
    url: '/refund/detail',
    method: 'get',
    params: { id }
  })
}


// 订单类型统计
export function orderTypeStatistics(data) {
  return request({
    url: '/order/orderTypeStatistics',
    method: 'get',
    params: data
  })
}

export function userOrderMemberList(data) {
  return request({
    url: '/order/userOrderMemberList',
    method: 'get',
    params: data
  })
}
// 充值概况
export function summary(data) {
  return request({
    url: '/charge-statistics/summary',
    method: 'post',
    data
  })
}
// 总部充值列表
export function hQRechargeList(data) {
  return request({
    url: '/charge-statistics/hq-list',
    method: 'post',
    data
  })
}
// 充值列表
export function rechargeList(data) {
  return request({
    url: '/charge-statistics/list',
    method: 'post',
    data
  })
}
// 门店充值列表
export function rechargeShopList(data) {
  return request({
    url: '/charge-statistics/shop-list',
    method: 'post',
    data
  })
}


